﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;

namespace scapeinStats
{
   public class userInfo
    {
        private int mEXP;
        private int mEXPtoLevel;
        private int mlevel;
        private int mrank;
        private int mvLevel;

        public void Clear()
        {
            this.mEXP = 0;
            this.mrank = 0;
            this.mlevel = 0;
            this.mvLevel = 0;
            this.mEXPtoLevel = 0;
        }

        public object experience(int lvl)
        {
            long num;
            int num3 = lvl;
            for (int i = 1; i <= num3; i++)
            {
                num = (long)Math.Round((double)(num3 + Conversion.Int((double)(i + (300.0 * Math.Pow(2.0, ((double)i) / 7.0))))));
            }
            return Math.Round((double)(((double)num3) / 4.0));
        }

        public int ExptoLevel()
        {
            this.mEXPtoLevel = (int)Math.Round(Conversion.Val(Operators.SubtractObject(this.experience(this.TrueLevel()), this.EXP)));
            return this.mEXPtoLevel;
        }

        public int TrueLevel()
        {
            int num2= 0;
            int eXP = this.EXP;
            if ((eXP >= 0) & (eXP <= 0x52))
            {
                num2 = 1;
            }
            if ((eXP >= 0x53) & (eXP <= 0xad))
            {
                num2 = 2;
            }
            if ((eXP >= 0xae) & (eXP <= 0x113))
            {
                num2 = 3;
            }
            if ((eXP >= 0x114) & (eXP <= 0x183))
            {
                num2 = 4;
            }
            if ((eXP >= 0x18f) & (eXP <= 0x1ff))
            {
                num2 = 5;
            }
            if ((eXP >= 0x200) & (eXP <= 0x289))
            {
                num2 = 6;
            }
            if ((eXP >= 650) & (eXP <= 800))
            {
                num2 = 7;
            }
            if ((eXP >= 0x321) & (eXP <= 0x3c8))
            {
                num2 = 8;
            }
            if ((eXP >= 0x3c9) & (eXP <= 0x481))
            {
                num2 = 9;
            }
            if ((eXP >= 0x482) & (eXP <= 0x54d))
            {
                num2 = 10;
            }
            if ((eXP >= 0x54e) & (eXP <= 0x62f))
            {
                num2 = 11;
            }
            if ((eXP >= 0x630) & (eXP <= 0x728))
            {
                num2 = 12;
            }
            if ((eXP >= 0x729) & (eXP <= 0x83a))
            {
                num2 = 13;
            }
            if ((eXP >= 0x83b) & (eXP <= 0x96a))
            {
                num2 = 14;
            }
            if ((eXP >= 0x96b) & (eXP <= 0xab9))
            {
                num2 = 15;
            }
            if ((eXP >= 0xaba) & (eXP <= 0xc2a))
            {
                num2 = 0x10;
            }
            if ((eXP >= 0xc2b) & (eXP <= 0xdc2))
            {
                num2 = 0x11;
            }
            if ((eXP >= 0xdc3) & (eXP <= 0xf84))
            {
                num2 = 0x12;
            }
            if ((eXP >= 0xf85) & (eXP <= 0x1175))
            {
                num2 = 0x13;
            }
            if ((eXP >= 0x1176) & (eXP <= 0x1399))
            {
                num2 = 20;
            }
            if ((eXP >= 0x139a) & (eXP <= 0x15f7))
            {
                num2 = 0x15;
            }
            if ((eXP >= 0x15f8) & (eXP <= 0x1892))
            {
                num2 = 0x16;
            }
            if ((eXP >= 0x1893) & (eXP <= 0x1b73))
            {
                num2 = 0x17;
            }
            if ((eXP >= 0x1b74) & (eXP <= 0x1ea1))
            {
                num2 = 0x18;
            }
            if ((eXP >= 0x1ea2) & (eXP <= 0x2223))
            {
                num2 = 0x19;
            }
            if ((eXP >= 0x2224) & (eXP <= 0x2601))
            {
                num2 = 0x1a;
            }
            if ((eXP >= 0x2602) & (eXP <= 0x2a47))
            {
                num2 = 0x1b;
            }
            if ((eXP >= 0x2a48) & (eXP <= 0x2efe))
            {
                num2 = 0x1c;
            }
            if ((eXP >= 0x2eff) & (eXP <= 0x3432))
            {
                num2 = 0x1d;
            }
            if ((eXP >= 0x3433) & (eXP <= 0x39f0))
            {
                num2 = 30;
            }
            if ((eXP >= 0x39f1) & (eXP <= 0x4047))
            {
                num2 = 0x1f;
            }
            if ((eXP >= 0x4048) & (eXP <= 0x4746))
            {
                num2 = 0x20;
            }
            if ((eXP >= 0x4747) & (eXP <= 0x4eff))
            {
                num2 = 0x21;
            }
            if ((eXP >= 0x4f00) & (eXP <= 0x5785))
            {
                num2 = 0x22;
            }
            if ((eXP >= 0x5786) & (eXP <= 0x60ee))
            {
                num2 = 0x23;
            }
            if ((eXP >= 0x60ef) & (eXP <= 0x6b50))
            {
                num2 = 0x24;
            }
            if ((eXP >= 0x6b51) & (eXP <= 0x76c7))
            {
                num2 = 0x25;
            }
            if ((eXP >= 0x76c8) & (eXP <= 0x836f))
            {
                num2 = 0x26;
            }
            if ((eXP >= 0x8370) & (eXP <= 0x9167))
            {
                num2 = 0x27;
            }
            if ((eXP >= 0x9168) & (eXP <= 0xa0d2))
            {
                num2 = 40;
            }
            if ((eXP >= 0xa0d3) & (eXP <= 0xb1d8))
            {
                num2 = 0x29;
            }
            if ((eXP >= 0xb1d9) & (eXP <= 0xc4a2))
            {
                num2 = 0x2a;
            }
            if ((eXP >= 0xc4a3) & (eXP <= 0xd960))
            {
                num2 = 0x2b;
            }
            if ((eXP >= 0xd961) & (eXP <= 0xf047))
            {
                num2 = 0x2c;
            }
            if ((eXP >= 0xf048) & (eXP <= 0x1098e))
            {
                num2 = 0x2d;
            }
            if ((eXP >= 0x1098f) & (eXP <= 0x12576))
            {
                num2 = 0x2e;
            }
            if ((eXP >= 0x12577) & (eXP <= 0x14445))
            {
                num2 = 0x2f;
            }
            if ((eXP >= 0x14446) & (eXP <= 0x16648))
            {
                num2 = 0x30;
            }
            if ((eXP >= 0x16649) & (eXP <= 0x18bd4))
            {
                num2 = 0x31;
            }
            if ((eXP >= 0x18bd5) & (eXP <= 0x1b548))
            {
                num2 = 50;
            }
            if ((eXP >= 0x1b549) & (eXP <= 0x1e30b))
            {
                num2 = 0x33;
            }
            if ((eXP >= 0x1e30c) & (eXP <= 0x21591))
            {
                num2 = 0x34;
            }
            if ((eXP >= 0x21592) & (eXP <= 0x24d57))
            {
                num2 = 0x35;
            }
            if ((eXP >= 0x24d58) & (eXP <= 0x28aeb))
            {
                num2 = 0x36;
            }
            if ((eXP >= 0x28aec) & (eXP <= 0x2cee7))
            {
                num2 = 0x37;
            }
            if ((eXP >= 0x2cee8) & (eXP <= 0x319f5))
            {
                num2 = 0x38;
            }
            if ((eXP >= 0x319f6) & (eXP <= 0x36cd1))
            {
                num2 = 0x39;
            }
            if ((eXP >= 0x36cd2) & (eXP <= 0x3c84d))
            {
                num2 = 0x3a;
            }
            if ((eXP >= 0x3c84e) & (eXP <= 0x42d4d))
            {
                num2 = 0x3b;
            }
            if ((eXP >= 0x42d4e) & (eXP <= 0x49ccf))
            {
                num2 = 60;
            }
            if ((eXP >= 0x49cd0) & (eXP <= 0x517eb))
            {
                num2 = 0x3d;
            }
            if ((eXP >= 0x517ec) & (eXP <= 0x59fd6))
            {
                num2 = 0x3e;
            }
            if ((eXP >= 0x59fd7) & (eXP <= 0x635e6))
            {
                num2 = 0x3f;
            }
            if ((eXP >= 0x635e7) & (eXP <= 0x6db93))
            {
                num2 = 0x40;
            }
            if ((eXP >= 0x6db94) & (eXP <= 0x7927d))
            {
                num2 = 0x41;
            }
            if ((eXP >= 0x7927e) & (eXP <= 0x85c70))
            {
                num2 = 0x42;
            }
            if ((eXP >= 0x85c71) & (eXP <= 0x93b67))
            {
                num2 = 0x43;
            }
            if ((eXP >= 0x93b68) & (eXP <= 0xa3192))
            {
                num2 = 0x44;
            }
            if ((eXP >= 0xa3193) & (eXP <= 0xb415a))
            {
                num2 = 0x45;
            }
            if ((eXP >= 0xb415b) & (eXP <= 0xc6d6c))
            {
                num2 = 70;
            }
            if ((eXP >= 0xc6d6d) & (eXP <= 0xdb8b8))
            {
                num2 = 0x47;
            }
            if ((eXP >= 0xdb8b9) & (eXP <= 0xf267e))
            {
                num2 = 0x48;
            }
            if ((eXP >= 0xf267f) & (eXP <= 0x10ba55))
            {
                num2 = 0x49;
            }
            if ((eXP >= 0x10ba56) & (eXP <= 0x127834))
            {
                num2 = 0x4a;
            }
            if ((eXP >= 0x127835) & (eXP <= 0x14647a))
            {
                num2 = 0x4b;
            }
            if ((eXP >= 0x14647b) & (eXP <= 0x1683fc))
            {
                num2 = 0x4c;
            }
            if ((eXP >= 0x1683fd) & (eXP <= 0x18dc0f))
            {
                num2 = 0x4d;
            }
            if ((eXP >= 0x18dc10) & (eXP <= 0x1b7297))
            {
                num2 = 0x4e;
            }
            if ((eXP >= 0x1b7298) & (eXP <= 0x1e4e13))
            {
                num2 = 0x4f;
            }
            if ((eXP >= 0x1e4e14) & (eXP <= 0x2175b1))
            {
                num2 = 80;
            }
            if ((eXP >= 0x2175b2) & (eXP <= 0x24f15e))
            {
                num2 = 0x51;
            }
            if ((eXP >= 0x24f15f) & (eXP <= 0x28c9d9))
            {
                num2 = 0x52;
            }
            if ((eXP >= 0x28c9da) & (eXP <= 0x2d08cc))
            {
                num2 = 0x53;
            }
            if ((eXP >= 0x2d08cd) & (eXP <= 0x31b8e1))
            {
                num2 = 0x54;
            }
            if ((eXP >= 0x31b8e2) & (eXP <= 0x36e5df))
            {
                num2 = 0x55;
            }
            if ((eXP >= 0x36e5e0) & (eXP <= 0x3c9cc5))
            {
                num2 = 0x56;
            }
            if ((eXP >= 0x3c9cc6) & (eXP <= 0x42ebef))
            {
                num2 = 0x57;
            }
            if ((eXP >= 0x42ebf0) & (eXP <= 0x49e336))
            {
                num2 = 0x58;
            }
            if ((eXP >= 0x49e337) & (eXP <= 0x51941b))
            {
                num2 = 0x59;
            }
            if ((eXP >= 0x51941c) & (eXP <= 0x5a11ee))
            {
                num2 = 90;
            }
            if ((eXP >= 0x5a11ef) & (eXP <= 0x637204))
            {
                num2 = 0x5b;
            }
            if ((eXP >= 0x637205) & (eXP <= 0x6dcbec))
            {
                num2 = 0x5c;
            }
            if ((eXP >= 0x6dcbed) & (eXP <= 0x7939a5))
            {
                num2 = 0x5d;
            }
            if ((eXP >= 0x7939a6) & (eXP <= 0x85d7e5))
            {
                num2 = 0x5e;
            }
            if ((eXP >= 0x85d7e6) & (eXP <= 0x93c660))
            {
                num2 = 0x5f;
            }
            if ((eXP >= 0x93c661) & (eXP <= 0xa32814))
            {
                num2 = 0x60;
            }
            if ((eXP >= 0xa32815) & (eXP <= 0xb423a5))
            {
                num2 = 0x61;
            }
            if ((eXP >= 0xb423a6) & (eXP <= 0xc6e3be))
            {
                num2 = 0x62;
            }
            if ((eXP >= 0xc6e3bf) & (eXP <= 0xdb9777))
            {
                num2 = 0x63;
            }
            if ((eXP >= 0xdb9778) & (eXP <= 0xf272d4))
            {
                num2 = 100;
            }
            if ((eXP >= 0xf272d5) & (eXP <= 0x10baf3f))
            {
                num2 = 0x65;
            }
            if ((eXP >= 0x10baf40) & (eXP <= 0x1278c1f))
            {
                num2 = 0x66;
            }
            if ((eXP >= 0x1278c20) & (eXP <= 0x1464f70))
            {
                num2 = 0x67;
            }
            if ((eXP >= 0x1464f71) & (eXP <= 0x168467d))
            {
                num2 = 0x68;
            }
            if ((eXP >= 0x168467e) & (eXP <= 0x18dc697))
            {
                num2 = 0x69;
            }
            if ((eXP >= 0x18dc698) & (eXP <= 0x1b72df4))
            {
                num2 = 0x6a;
            }
            if ((eXP >= 0x1b72df5) & (eXP <= 0x1e4e496))
            {
                num2 = 0x6b;
            }
            if ((eXP >= 0x1e4e497) & (eXP <= 0x2175d55))
            {
                num2 = 0x6c;
            }
            if ((eXP >= 0x2175d56) & (eXP <= 0x24f16fc))
            {
                num2 = 0x6d;
            }
            if ((eXP >= 0x24f16fd) & (eXP <= 0x28c9d88))
            {
                num2 = 110;
            }
            if ((eXP >= 0x28c9d89) & (eXP <= 0x2d08b88))
            {
                num2 = 0x6f;
            }
            if ((eXP >= 0x2d08b89) & (eXP <= 0x31b8ba4))
            {
                num2 = 0x70;
            }
            if ((eXP >= 0x31b8ba5) & (eXP <= 0x36e5a45))
            {
                num2 = 0x71;
            }
            if ((eXP >= 0x36e5a46) & (eXP <= 0x3c9c772))
            {
                num2 = 0x72;
            }
            if ((eXP >= 0x3c9c773) & (eXP <= 0x42eb8d7))
            {
                num2 = 0x73;
            }
            if ((eXP >= 0x42eb8d8) & (eXP <= 0x49e2c0b))
            {
                num2 = 0x74;
            }
            if ((eXP >= 0x49e2c0c) & (eXP <= 0x5193909))
            {
                num2 = 0x75;
            }
            if ((eXP >= 0x519390a) & (eXP <= 0x5a114f0))
            {
                num2 = 0x76;
            }
            if ((eXP >= 0x5a114f1) & (eXP <= 0x637150e))
            {
                num2 = 0x77;
            }
            if ((eXP >= 0x637150f) & (eXP <= 0x6dcb235))
            {
                num2 = 120;
            }
            if ((eXP >= 0x6dcb236) & (eXP <= 0x7938c73))
            {
                num2 = 0x79;
            }
            if ((eXP >= 0x7938c74) & (eXP <= 0x85d6f23))
            {
                num2 = 0x7a;
            }
            if ((eXP >= 0x85d6f24) & (eXP <= 0x93c5570))
            {
                num2 = 0x7b;
            }
            if ((eXP >= 0x93c5571) & (eXP <= 0xa326f50))
            {
                num2 = 0x7c;
            }
            if ((eXP >= 0xa326f51) & (eXP <= 0xb422703))
            {
                num2 = 0x7d;
            }
            if (eXP >= 0xb422704)
            {
                num2 = 0x7e;
            }
            return num2;
        }

        public int EXP
        {
            get
            {
                return this.mEXP;
            }
            set
            {
                if (value <= 0)
                {
                    this.mEXP = 1;
                }
                else
                {
                    this.mEXP = value;
                }
            }
        }

        public int Level
        {
            get
            {
                return this.mlevel;
            }
            set
            {
                if (value <= 0)
                {
                    this.mlevel = 1;
                }
                else
                {
                    this.mlevel = value;
                }
            }
        }

        public int Rank
        {
            get
            {
                return this.mrank;
            }
            set
            {
                if (value <= 0)
                {
                    this.mrank = 0;
                }
                else
                {
                    this.mrank = value;
                }
            }
        }
    }       
}
